<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>


<chiptrack:checkLogon sourcePage="/customerRelationshipSearch.do"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript">

    function search(){

        var form = document.customer_relationship_search;

        if(form.customerId.value == 0){
            form.action.value="SearchAll";
        }else{
            form.action.value = "Search";
        }

        form.submit();

    }
</SCRIPT>
<!-- Top Header Start-->

<%@ include file="/jsp/includes/header.jsp" %>

<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

	<%@ include file="/jsp/sales/sales_menu.jsp" %>

    </TD>
<!-- end of the side navigations -->
    <TD bgcolor="#ffffff">
        <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
    <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
    <TD valign="top" width="100%">
        <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
        <BR>
<!-- from here your body starts -->

<html:form name="customer_relationship_search" method="post" action="/customerRelationshipSearch.do" scope="request" type="com.scalar.chiptrack.sales.forms.CustomerRelationshipSearchForm" onsubmit="javascript:return search(document.customer_relationship_search);">
        <center><span class="NArialW">Customer Relationships</span></center>
        <img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

        <table border="0" width="70%" align=right>
          <tr><td colspan =7 align="left" class='NArialL'><font styleClass="NArialL" id="message1" color="green"  />&nbsp;</font></td></tr>
          <tr><td colspan =7 align="left" class='NArialL'><font styleClass="NArialL" id="message2" color="FF0000"  />&nbsp;</font></td></tr>
            <!--<tr><td colspan =7 class="NArialL"><chiptrack:info styleClass="NArialL" /></td></tr> -->
            <!-- <tr><td colspan =7 class="NArialL"><chiptrack:errors styleClass="NArialL" /></td></tr> -->
          <tr>
             <td>
                <table border="0" width="100%" align=right>
	              <tr>
                    <td width="20%"><font class="NArialL">Customers</font></td>
                    <td width="50%"><font class="NArialL">
      	              <html:select name="customerRelationshipSearchForm" property="customerId" styleClass="txfield">
	                  <html:options collection="customerList" property="value" labelProperty="label" />
                      </html:select>
                    </td>
                    <td width="30%">&nbsp;</td>
                  </tr>
                  <tr>
                    <td colspan=3 > &nbsp;</td>
                  </tr>
                  <tr>
                    <td with="20%"> &nbsp;</td>
                    <td colspan=2 align=center>
    	            <input type=image align="left" border="0" src="<%=chipTracContext%>/jsp/includes/images/search.gif" width="53" height="17" onmouseover="window.status='Click here to search for Customers';return true" onmouseout="window.status='';return true" title="Click here to Search for Customer" onclick="javascript:search()"><%--</a> --%> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <!-- <a href="javascript:document.customer_relationship_search.reset();" onmouseover="window.status='Click to reset ';return true" onmouseout="window.status='';return true" title="Click here to Reset"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17"></a> -->
                    </td>
                  </tr>
                </table>
              </td>
          </tr>
          <tr>
              <td><img height=10 src="images/spacer.gif"></td>
          </tr>
          <tr>
            <td>
              <table border="0" width="100%" align=right>
                  <tr>
                    <td class="NArialL" colspan=4>
                            <IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
                    </td>
                  </tr>
                        <% 	String showTable =(String)request.getAttribute ("showTable");
                            String allEmpty =(String)request.getAttribute ("AllEmpty");
                        %>

                        <% if( "TRUE".equals(showTable) ) {%>
                  <tr>
                    <td width="45%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Customer Name</font></td>
                    <td width="25%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Actions</font></font></td>
                    <td width="30%" align="center">&nbsp;</td>
                  </tr>
                        <% } else {%> <TR></tr><% }%>
                          <% int bgcount = 0;%>
                        <logic:iterate id="Customer" name="allCustomerList">
                           <% bgcount = bgcount + 1; %>
                  <tr>
                    <td width="45%" <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL">
                    <bean:write name="Customer" property="customerName" /></font></td>

                    <td width="25%" align="center" <%if(bgcount%2==0) {%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL">
                    <logic:equal name="showModify" value="TRUE">
                        <chiptrack:linkCustomer page="/customerRelationship.do?action=EditCustomer"  onmouseover="window.status='Click to Edit Customer Relationship';return true" onmouseout="window.status='';return true">Edit</chiptrack:linkCustomer>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </logic:equal>

                    <chiptrack:linkCustomer page="/customerRelationship.do?action=ViewCustomer"  onmouseover="window.status='Click to View Customer Details';return true" onmouseout="window.status='';return true">View</chiptrack:linkCustomer>
                    </font></td>
                    <td width="30%" align="center">&nbsp;</td>
                  </tr>
                      </logic:iterate>
              </table>
  	         </td>
          </tr>
        </table>
<input type="hidden" name="action" value="" >

</html:form>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->
</BODY>
</HTML>
